<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>SC2API: sc2::ActionInterface Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="SC2-Logo.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">SC2API
   </div>
   <div id="projectbrief">An API for AI for StarCraft II</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><b>sc2</b></li><li class="navelem"><a class="el" href="classsc2_1_1_action_interface.html">ActionInterface</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="classsc2_1_1_action_interface-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">sc2::ActionInterface Class Reference<span class="mlabels"><span class="mlabel">abstract</span></span></div>  </div>
</div><!--header-->
<div class="contents">

<p><code>#include &lt;<a class="el" href="sc2__interfaces_8h_source.html">sc2_interfaces.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:ad401d286fabc349133f27e0fc29099f2"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsc2_1_1_action_interface.html#ad401d286fabc349133f27e0fc29099f2">UnitCommand</a> (Tag unit_tag, <a class="el" href="classsc2_1_1_s_c2_type.html">AbilityID</a> ability)=0</td></tr>
<tr class="separator:ad401d286fabc349133f27e0fc29099f2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a89d51301c22e6c28672be771a3db47e2"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsc2_1_1_action_interface.html#a89d51301c22e6c28672be771a3db47e2">UnitCommand</a> (Tag unit_tag, <a class="el" href="classsc2_1_1_s_c2_type.html">AbilityID</a> ability, const <a class="el" href="structsc2_1_1_point2_d.html">Point2D</a> &amp;point)=0</td></tr>
<tr class="separator:a89d51301c22e6c28672be771a3db47e2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5aacde49d90f8d6637ff0b69891448c4"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsc2_1_1_action_interface.html#a5aacde49d90f8d6637ff0b69891448c4">UnitCommand</a> (Tag unit_tag, <a class="el" href="classsc2_1_1_s_c2_type.html">AbilityID</a> ability, Tag target_tag)=0</td></tr>
<tr class="separator:a5aacde49d90f8d6637ff0b69891448c4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a23192496f856ac368d17da913cd97eac"><td class="memItemLeft" align="right" valign="top"><a id="a23192496f856ac368d17da913cd97eac"></a>
virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsc2_1_1_action_interface.html#a23192496f856ac368d17da913cd97eac">UnitCommand</a> (const std::vector&lt; Tag &gt; &amp;unit_tags, <a class="el" href="classsc2_1_1_s_c2_type.html">AbilityID</a> ability)=0</td></tr>
<tr class="memdesc:a23192496f856ac368d17da913cd97eac"><td class="mdescLeft">&#160;</td><td class="mdescRight">Issues a command to multiple units (prefer this where possible). Same as <a class="el" href="classsc2_1_1_action_interface.html#ad401d286fabc349133f27e0fc29099f2">UnitCommand(Tag, AbilityID)</a>. <br /></td></tr>
<tr class="separator:a23192496f856ac368d17da913cd97eac"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9c68a84725771092f731061797c0de5d"><td class="memItemLeft" align="right" valign="top"><a id="a9c68a84725771092f731061797c0de5d"></a>
virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsc2_1_1_action_interface.html#a9c68a84725771092f731061797c0de5d">UnitCommand</a> (const std::vector&lt; Tag &gt; &amp;unit_tags, <a class="el" href="classsc2_1_1_s_c2_type.html">AbilityID</a> ability, const <a class="el" href="structsc2_1_1_point2_d.html">Point2D</a> &amp;point)=0</td></tr>
<tr class="memdesc:a9c68a84725771092f731061797c0de5d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Issues a command to multiple units (prefer this where possible). Same as UnitCommand(Tag, AbilityID, Point2D). <br /></td></tr>
<tr class="separator:a9c68a84725771092f731061797c0de5d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3a5fd10e721f25ac756dd2fdb20ebd16"><td class="memItemLeft" align="right" valign="top"><a id="a3a5fd10e721f25ac756dd2fdb20ebd16"></a>
virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsc2_1_1_action_interface.html#a3a5fd10e721f25ac756dd2fdb20ebd16">UnitCommand</a> (const std::vector&lt; Tag &gt; &amp;unit_tags, <a class="el" href="classsc2_1_1_s_c2_type.html">AbilityID</a> ability, Tag target_tag)=0</td></tr>
<tr class="memdesc:a3a5fd10e721f25ac756dd2fdb20ebd16"><td class="mdescLeft">&#160;</td><td class="mdescRight">Issues a command to multiple units (prefer this where possible). Same as <a class="el" href="classsc2_1_1_action_interface.html#a5aacde49d90f8d6637ff0b69891448c4">UnitCommand(Tag, AbilityID, Tag)</a>. <br /></td></tr>
<tr class="separator:a3a5fd10e721f25ac756dd2fdb20ebd16"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a29a55f8dd4f9230864caa1deb228ae33"><td class="memItemLeft" align="right" valign="top">virtual const std::vector&lt; Tag &gt; &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsc2_1_1_action_interface.html#a29a55f8dd4f9230864caa1deb228ae33">Commands</a> () const =0</td></tr>
<tr class="separator:a29a55f8dd4f9230864caa1deb228ae33"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5f66f9b7eaf1d6a681694927b8605004"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsc2_1_1_action_interface.html#a5f66f9b7eaf1d6a681694927b8605004">ToggleAutocast</a> (Tag unit_tag, <a class="el" href="classsc2_1_1_s_c2_type.html">AbilityID</a> ability)=0</td></tr>
<tr class="separator:a5f66f9b7eaf1d6a681694927b8605004"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab3990c306215b3cb8d5e62533f72db62"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsc2_1_1_action_interface.html#ab3990c306215b3cb8d5e62533f72db62">ToggleAutocast</a> (const std::vector&lt; Tag &gt; &amp;unit_tags, <a class="el" href="classsc2_1_1_s_c2_type.html">AbilityID</a> ability)=0</td></tr>
<tr class="separator:ab3990c306215b3cb8d5e62533f72db62"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af054d2a35e7eb740109f63011090ea50"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsc2_1_1_action_interface.html#af054d2a35e7eb740109f63011090ea50">SendActions</a> ()=0</td></tr>
<tr class="separator:af054d2a35e7eb740109f63011090ea50"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>The <a class="el" href="classsc2_1_1_action_interface.html">ActionInterface</a> issues actions to units in a game. Not available in replays. Guaranteed to be valid when the OnStep event is called. </p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a id="a29a55f8dd4f9230864caa1deb228ae33"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a29a55f8dd4f9230864caa1deb228ae33">&#9670;&nbsp;</a></span>Commands()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual const std::vector&lt;Tag&gt;&amp; sc2::ActionInterface::Commands </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Returns a list of unit tags that have sent commands out in the last call to SendActions. This will be used to determine if a unit actually has a command when the observation is received. </p><dl class="section return"><dt>Returns</dt><dd>Array of units that have sent commands. </dd></dl>

</div>
</div>
<a id="af054d2a35e7eb740109f63011090ea50"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af054d2a35e7eb740109f63011090ea50">&#9670;&nbsp;</a></span>SendActions()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void sc2::ActionInterface::SendActions </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>This function sends out all batched unit commands. You DO NOT need to call this function in non real time simulations since it is automatically called when stepping the simulation forward. You only need to call this function in a real time simulation. For example, if you wanted to move 20 marines to some position on the map you'd want to batch all of those unit commands and send them at once. </p>

</div>
</div>
<a id="a5f66f9b7eaf1d6a681694927b8605004"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5f66f9b7eaf1d6a681694927b8605004">&#9670;&nbsp;</a></span>ToggleAutocast() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void sc2::ActionInterface::ToggleAutocast </td>
          <td>(</td>
          <td class="paramtype">Tag&#160;</td>
          <td class="paramname"><em>unit_tag</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classsc2_1_1_s_c2_type.html">AbilityID</a>&#160;</td>
          <td class="paramname"><em>ability</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Enables or disables autocast of an ability on a unit. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">unit_tag</td><td>The unit to toggle the ability on. </td></tr>
    <tr><td class="paramname">ability</td><td>The ability to be toggled. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ab3990c306215b3cb8d5e62533f72db62"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab3990c306215b3cb8d5e62533f72db62">&#9670;&nbsp;</a></span>ToggleAutocast() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void sc2::ActionInterface::ToggleAutocast </td>
          <td>(</td>
          <td class="paramtype">const std::vector&lt; Tag &gt; &amp;&#160;</td>
          <td class="paramname"><em>unit_tags</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classsc2_1_1_s_c2_type.html">AbilityID</a>&#160;</td>
          <td class="paramname"><em>ability</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Enables or disables autocast of an ability on a list of units. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">unit_tags</td><td>The units to toggle the ability on. </td></tr>
    <tr><td class="paramname">ability</td><td>The ability to be toggled. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ad401d286fabc349133f27e0fc29099f2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad401d286fabc349133f27e0fc29099f2">&#9670;&nbsp;</a></span>UnitCommand() <span class="overload">[1/3]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void sc2::ActionInterface::UnitCommand </td>
          <td>(</td>
          <td class="paramtype">Tag&#160;</td>
          <td class="paramname"><em>unit_tag</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classsc2_1_1_s_c2_type.html">AbilityID</a>&#160;</td>
          <td class="paramname"><em>ability</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Issues a command to a unit. Self targeting. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">unit_tag</td><td>The unit to send the command to. </td></tr>
    <tr><td class="paramname">ability</td><td>The ability id of the command. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a89d51301c22e6c28672be771a3db47e2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a89d51301c22e6c28672be771a3db47e2">&#9670;&nbsp;</a></span>UnitCommand() <span class="overload">[2/3]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void sc2::ActionInterface::UnitCommand </td>
          <td>(</td>
          <td class="paramtype">Tag&#160;</td>
          <td class="paramname"><em>unit_tag</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classsc2_1_1_s_c2_type.html">AbilityID</a>&#160;</td>
          <td class="paramname"><em>ability</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structsc2_1_1_point2_d.html">Point2D</a> &amp;&#160;</td>
          <td class="paramname"><em>point</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Issues a command to a unit. Targets a point. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">unit_tag</td><td>The unit to send the command to. </td></tr>
    <tr><td class="paramname">ability</td><td>The ability id of the command. </td></tr>
    <tr><td class="paramname">point</td><td>The 2D world position to target. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a5aacde49d90f8d6637ff0b69891448c4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5aacde49d90f8d6637ff0b69891448c4">&#9670;&nbsp;</a></span>UnitCommand() <span class="overload">[3/3]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void sc2::ActionInterface::UnitCommand </td>
          <td>(</td>
          <td class="paramtype">Tag&#160;</td>
          <td class="paramname"><em>unit_tag</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classsc2_1_1_s_c2_type.html">AbilityID</a>&#160;</td>
          <td class="paramname"><em>ability</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Tag&#160;</td>
          <td class="paramname"><em>target_tag</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Issues a command to a unit. Targets another unit. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">unit_tag</td><td>The unit to send the command to. </td></tr>
    <tr><td class="paramname">ability</td><td>The ability id of the command. </td></tr>
    <tr><td class="paramname">target_tag</td><td>The unit that is a target of the unit getting the command. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>include/sc2api/<a class="el" href="sc2__interfaces_8h_source.html">sc2_interfaces.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>
